<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="jquery.min.js"></script>
    <style>
        div {
            width: 400px;
            height: 400px;
            background: #000;
        }
    </style>
</head>

<body>
    <script>
        $(function() {
            $(document).on("keydown", function(e) {

                if (e.keyCode === 13) {
                    $("div").css("background", "red")
                }
            })
        })
    </script>
    <div></div>
</body>

</html>